package web.request;

import exceptions.ParamsNullException;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

public class BaseRequestBody implements RequestBody {

    public BaseRequestBody () {}

    @Override
    public void setProperties (Object source, RequestBody target) throws InvocationTargetException, IllegalAccessException {
        if (null != target && null != source) {
            BeanUtils.copyProperties(target,source);
        } else {
            new ParamsNullException();
        }
    }
}
